package com.xuecheng.framework.domain.cms.request;

import com.xuecheng.framework.model.response.ResultCode;
import lombok.ToString;

/**
 * @Author Andrew Yang
 * @ClassName CmsCode
 * @Description
 * @Package com.xuecheng.framework.domain.cms.request
 * @create 2020-01-15 00:53
 */
@ToString
public enum CmsCode implements ResultCode {
    /**
     * 参数不存在
     */
    CMS_ADDPAGE_EMPTY(false, 24000, "参数不存在！"),
    CMS_ADDPAGE_EXISTSNAME(false, 24001, "页面名称已存在！"),
    CMS_GENERATEHTML_DATAURLISNULL(false, 24002, "dataUrl不存在！"),
    CMS_GENERATEHTML_DATAISNULL(false, 24002, "根据页面的url获取不到数据！"),
    CMS_GENERATEHTML_TEMPLATEISNULL(false, 24003, "根据页面的url获取不到模板！"),
    CMS_GENERATEHTML_GRIDFSFILEISNULL(false, 24004, "Grid文件系统中查询到相关文件！"),
    CMS_GENERATEHTML_HTMLISNULL(false, 24005, "没有获取到html！"),
    CMS_PAGE_NOTEXISTS(false, 24006, "页面不存在！"),
    CMS_COURSE_PERVIEVISNULL(false, 24007, "预览页面为空！");


    /**
     * 操作结果
     */
    boolean success;
    /**
     * 操作代码
     */
    int code;
    /**
     * 提示信息
     */
    String message;

    CmsCode(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
